/*
 * @Author: Clark
 * @Email: haixuanwoTxh@gmail.com
 * @Date: 2023-01-04 15:30:26
 * @LastEditors: Clark
 * @LastEditTime: 2023-01-04 15:32:40
 * @Description: file content
 */

#include "apue.h"
#include <fcntl.h>

#define RWRWRW (S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)

int main()
{
    umask(0);

    if (creat("foo", RWRWRW) < 0)
    {
        err_sys("creat error for foo");
    }

    umask(S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);
    if (creat("bar", RWRWRW) < 0)
    {
        err_sys("creat error for bar");
    }

    exit(0);
}
